package com.czkt.shop.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.czkt.shop.pojo.SpeName;
import com.czkt.shop.mapper.SpeNameMapper;
import com.czkt.shop.service.ISpeNameService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author baomidou
 * @since 2024-09-04
 */
@Service
public class SpeNameServiceImpl extends ServiceImpl<SpeNameMapper, SpeName> implements ISpeNameService {

    @Override
    public List<SpeName> list(Long spuId) {

        LambdaQueryWrapper<SpeName> queryWrapper = new LambdaQueryWrapper<>();

        queryWrapper.eq(spuId != null,SpeName::getSpuId,spuId);

        return baseMapper.selectList(queryWrapper);

    }
}
